package oh.june.kwon.soapClient;

import org.ksoap2.serialization.SoapObject;

public class SoapDataRow {

	private SoapObject _soapObject;

	public SoapDataRow(SoapObject soapObject) {
		_soapObject = soapObject;
	}

	public String get(String columnName) {
		Object object = null;
		
		object = _soapObject.getProperty(columnName);

		if (object instanceof SoapObject)
			return "";

		return object.toString();
	}

	public String get(String columnName, String defaultValue) {
		Object object = null;
		try {
			object = _soapObject.getProperty(columnName);
			
			if (object instanceof SoapObject)
				return "";
		} catch (RuntimeException re) {
			return defaultValue.toString();
		}

		return object.toString();
	}

}
